{layout name="layout/layout" /}
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
        <li class="layui-this">帮助列表</li>
    </ul>
</div>
<a class="layui-btn" href="{:Url('Admin/Help/add')}">添 加</a>
<div class="layui-form">
    <table class="layui-table">
            <colgroup>
                <col width="5%">
                <col width="15%">
                <col width="40%">
                <col width="7%">
                <col width="30%">
             </colgroup>
        <thead>
            <tr style="background-color: #f5f5f5;font-size: 17px">
                <td>排序</td>
                <td>问题</td>
                <td>答案</td>
                <td>添加时间</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            {if($data)} {foreach $data as $k=>$v}
            <tr>

                <td>
                    {$v->sort}
                </td>
                <td>
                    {$v->problem} &nbsp;
                </td>
                <td>
                    {$v->answer} &nbsp;
                </td>
                <td>
                    {$v->time|date="Y-m-d",###}

                </td>
                <td>
                    <div class="layui-btn-group">
                        <a class="layui-btn layui-btn-xs" href="{:Url('admin/help/edit',['id'=>$v->id])}">编辑</a>
                        <a class="dell layui-btn layui-btn-danger layui-btn-xs"  help_id="{$v->id}" href="#">删除</a>
                    </div>
                </td>
            </tr>
            {/foreach} {/if}
        </tbody>
    </table>
    {$page}
</div>
<script>
    $('.dell').click(function () {
        var id = $(this).attr('help_id');
        layer.confirm('是否确认删除？', {
            btn: ['确认', '取消'] //按钮
        }, function () {
            $.post("{:Url('admin/help/del')}", { help_id: id }, function (data) {
                window.location.reload();
                if (!data) {
                    layer.msg('删除失败');
                }
            });
        })
    });



</script>